Page({
  data: {
  list: []
  },
  onLoad() {
  wx.cloud.database().collection('news')
  .orderBy('time','desc')
  .get()
  .then(res => {
    this.setData({
    list: res.data
    })
    })
    .catch(res => {
    console.log('获取新闻列表失败')
    })
    },
    goDetail(e) {
    wx.navigateTo({
    url: '/pages/detail/detail?id=' + e.currentTarget.dataset.id,
    })
    }
    })